<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JQuery中的Promise</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<button id="btn">获取数据</button>
</body>

<script>
  $(function () {
      $('#btn').on('click', function () {
          $.ajax({
              url:'./data.json',
              type:'get',
              dataType:'json'
          }).then(function (data) {
              console.log(data)
          })
      })
  })
</script>
</html>
